package frontend.util;

public class InputValidator {

	public static String validInput(String name, String firstName,
			String mobileNr, String email) {
		String result ="";
		if (name.equals("")) {
			result = result.concat("Insert name\n");
		}
		if (firstName.equals("")) {
			result = result.concat("Insert first name\n");
		}
		if (mobileNr.equals("") || !mobileNr.matches("(([+]*)+[0-9]{10,11})")) {
			result = result.concat("Invalid phone number\n");
		}
		if (email.equals("")
				|| !email
						.matches("([a-zA-Z0-9]+(?:[._+-][a-zA-Z0-9]+)*)@([a-zA-Z0-9]+(?:[.-][a-zA-Z0-9]+)*[.][a-zA-Z]{2,})")) {
			result = result.concat("Invalid email address\n");
		}

		return result;
	}
	
}
